package com.lcdpg.lcdp.auth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lcdpg.lcdp.auth.model.Permission;
import com.lcdpg.lcdp.auth.model.Role;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @author admin
 * @version 1.0.0
 * @ClassName RoleMapper.java
 * @Description TODO
 * @createTime 2025年05月29日 16:23:00
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("SELECT rp.* FROM roles r " +
            "LEFT JOIN role_permissions rp ON r.id = rp.role_id " +
            "WHERE r.id = #{roleId}")
    Set<Permission> findPermissionsByRoleId(Long roleId);
}
